﻿using System;
using System.Data;

public partial class System_Pages_Settings_SiteDetails : SiteFox.Base.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) 
        {
            SiteFox.Business.Model.Site _Site = SiteFox.Business.Manager.Site.Get();
            ucc_Site_Title.Value = _Site.Title;
            ucc_Site_GenerateMeta.Value = _Site.GenerateMeta;
            ucc_Site_Descritpion.Value = _Site.Description;
            ucc_Site_Keywords.Value = _Site.Keywords;
            ucc_Site_ReVisit.Value = _Site.ReVisit.ToString();
            if(_Site.RobotToDo != "")
            {
                ddl_Site_RobotToDo_Value.SelectedValue = _Site.RobotToDo;
            }
            ucc_Site_Author.Value = _Site.Author;
            ucc_Site_Copyrights.Value = _Site.Copyrights;
        }
    }
    protected void lib_SaveSiteDetails_Click(object sender, EventArgs e)
    {
        SiteFox.Business.Model.Site _Site = SiteFox.Business.Manager.Site.Get();
        _Site.Title = ucc_Site_Title.Value;
        _Site.GenerateMeta = ucc_Site_GenerateMeta.Value;
        _Site.Description = ucc_Site_Descritpion.Value;
        _Site.Keywords = ucc_Site_Keywords.Value;
        _Site.ReVisit = Convert.ToInt32(ucc_Site_ReVisit.Value);
        _Site.RobotToDo = ddl_Site_RobotToDo_Value.SelectedValue;
        _Site.Author = ucc_Site_Author.Value;
        _Site.Copyrights = ucc_Site_Copyrights.Value;

        SiteFox.Business.Manager.Site.Edit(_Site);
        ucc_Message.Value = Resources.dcCommon.dc_SettingSuccessfullySaved;
    }
}